package com.ruoyi.factory.qylock.controller.api;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.factory.common.utils.RequestUtil;
import com.ruoyi.factory.qylock.service.IndividualTaxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * @author: LiuJiaji
 * @date: 2025/6/19 15:48
 * @description: TODO 离职个人所得税通知
 * @param:
 * @return:
 **/
@RestController
@RequestMapping("/api/individualTax")
public class IndividualTaxController {

    @Autowired
    private IndividualTaxService individualTaxService;

    /**
     * @author: LiuJiaji
     * @date: 2025/6/19 15:50
     * @description: TODO 离职通知员工签署个人所得税通知 定时任务查询,两分钟查询一次,查询一个月的
     * @param:
     * @return:
     **/
    @Scheduled(cron="0 0/5 * ? * *")
    public void individualTaxesign(){
        individualTaxService.individualTaxesign();
    }

    @PostMapping("/upStatusNotify")
    public AjaxResult upStatus(HttpServletRequest request){
        Map<String, String> notifyResult = RequestUtil.getRequestParams(request);
        return individualTaxService.upStatus(notifyResult);
    }
}
